# 1、电影名
# 2、类型
# 3、上映地点
# 4、上映时间
# 5、评分
import requests
from lxml import etree
url = 'https://ssr1.scrape.center/'
response = requests.get(url)
print(response.status_code)
# print(response.text)
html = response.text
# xpath的使用
# 1、得到一个etree对象
ehtml = etree.HTML(html)
# 2、通过xpath查找
# 电影名
xtitle = ehtml.xpath("//div[@class='p-h el-col el-col-24 el-col-xs-9 el-col-sm-13 el-col-md-16']/a/h2/text()")
print(xtitle)
# 类型
xtitle = ehtml.xpath("//div[@class='categories']/button/span/text()")
print(xtitle)
# 上映地点
xtitle = ehtml.xpath("//div[@class='m-v-sm info']/span[1]/text()")
print(xtitle)
# 上映时间
xtitle = ehtml.xpath("//div[@class='m-v-sm info'][2]/span/text()")
print(xtitle)
# 评分
xtitle = ehtml.xpath("//div[@class='el-col el-col-24 el-col-xs-5 el-col-sm-5 el-col-md-4']/p/text()")
for i in xtitle:
    print(i[17:20])